//
//  WJSimpleNetwork.h
//  boss
//
//  Created by 王军 on 16/10/9.
//  Copyright © 2016年 王军. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface WJSimpleNetwork : NSObject<NSURLSessionDelegate>

/**
 format:JSON
 **/
+(void)getMethod:(NSURL *)url format:(NSString *)format success:(void (^)(id result))success fail:(void(^)(NSString *)) fail;

/**
 返回字符串
 **/
+(void)getMethodContent:(NSURL *)url success:(void(^)(NSString *))success fail:(void(^)(NSString *)) fail;

/**
 返回字典
 **/
+(void)getMethodJson:(NSURL *)url success:(void(^)(NSMutableDictionary *))success fail:(void(^)(NSString *)) fail;

/**
 post请求
 **/
+(void)postParameters:(NSMutableDictionary *)params WithUrl:(NSURL *)url setRequest:(void(^)(NSMutableDictionary *))setRequest success:(void(^)(NSDictionary *))success fail:(void(^)(NSString *)) fail;

+(void)postParameters:(NSMutableDictionary *)params WithUrl:(NSURL *)url success:(void(^)(NSDictionary *))success fail:(void(^)(NSString *)) fail;

+(void)postParameters:(NSMutableDictionary *)params WithUrlStr:(NSString *)urlStr  success:(void(^)(NSDictionary *))success fail:(void(^)(NSString *)) fail;

+(void)uploadImage:(NSMutableDictionary *)params data:(NSData *)imageData WithUrlStr:(NSString *)urlStr  success:(void(^)(NSDictionary *))success fail:(void(^)(NSString *)) fail;

+(void)request:(NSString *)method params:(NSMutableDictionary *)params WithUrl:(NSURL *)url setRequest:(void(^)(NSMutableDictionary *))setRequest success:(void(^)(NSDictionary *))success fail:(void(^)(NSString *)) fail;

@end
